import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
import { createRouter, createWebHistory } from 'vue-router'
import { baseRouter, createRouterGuard } from './base'
import autoRouters from '~pages'

NProgress.configure({ showSpinner: false })
const router = createRouter({
  history: createWebHistory('/'),
  routes: import.meta.env.VITE_AUTO_ROUTER === 'true' ? autoRouters : baseRouter,
})
createRouterGuard(router)
export default router
